<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input id="d1" placeholder="账号"/>
		<input id="d2" placeholder="密码"/>
		<input id="d3" placeholder="取款金额"/>
		<input type="button" value="取款" onclick="f()"/>
		<script>
			var rightAccount="123456789";
			var rightPwd="123456";
			var accountMoney=6800;
			var f=function(){
				quQian(d1.value,d2.value,d3.value)
			};
			function quQian(account,pwd,money){
				if(account!=rightAccount){
					alert("账号有误");
					return;
				}
				if(pwd!=rightPwd){
					alert("密码有误");
					return;
				}
				if(money>accountMoney){
					alert("余额不足");
					return;
				}
				if(money>accountMoney){
					alert("余额不足");
					return;
				}
				if(money.length==0){
					alert("请您输入正确的金额");
					return;
				}
				if(money.length==0){
					alert("请您输入正确的金额");
					return;
				}
				if(isNaN(money)){
					alert("请您输入正确的取款金额");
					return;
				}
				accountMoney=accountMoney-money;
				alert("取款成功，您余额还剩："+accountMoney)
			}
		</script>
	</body>
</html>
